package com.graden.background.service.sysmenufunction.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.graden.background.repository.sysmenufunction.SysMenuFunctionMapper;
import com.graden.background.repository.sysmenufunction.entity.SysMenuFunction;
import com.graden.background.service.sysmenufunction.ISysMenuFunctionService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 菜单功能权限 服务实现类
 * </p>
 *
 * @author zjf
 * @since 2019-03-21
 */
@Service
public class SysMenuFunctionServiceImpl extends ServiceImpl<SysMenuFunctionMapper, SysMenuFunction> implements ISysMenuFunctionService {

	/**
	 * 获取菜单下的功能权限
	 */
	@Override
	public List<SysMenuFunction> getFunctionsByMenuId(Integer menuId) {
		QueryWrapper<SysMenuFunction> queryWrapper = new QueryWrapper<>();
		queryWrapper.eq("menu_id", menuId);
		queryWrapper.eq("is_show", true);
		queryWrapper.eq("status", true);
		return this.list(queryWrapper);
	}

}
